import request from '@/utils/request'

// 查询客户收货地址列表
export function listAddress(query) {
  return request({
    url: '/prod-api/customer/address/list',
    method: 'get',
    params: query
  })
}

export function selectCustomer(query) {
  return request({
    url: '/prod-api/customer/address/selectCustomer',
    method: 'get',
    params: query
  })
}

export function listInvoice(query) {
  return request({
    url: '/prod-api/customer/invoice/list',
    method: 'get',
    params: query
  })
}


// 查询客户收货地址详细
export function getAddress(addressUid) {
  return request({
    url: '/prod-api/customer/address/' + addressUid,
    method: 'get'
  })
}

// 新增客户收货地址
export function addAddress(data) {
  return request({
    url: '/prod-api/customer/address',
    method: 'post',
    data: data
  })
}

// 修改客户收货地址
export function updateAddress(data) {
  return request({
    url: '/prod-api/customer/address',
    method: 'put',
    data: data
  })
}

// 删除客户收货地址
export function delAddress(addressUid) {
  return request({
    url: '/prod-api/customer/address/' + addressUid,
    method: 'delete'
  })
}

// 修改客户状态
export function updateAddressStatus(addressUid, dataStatus){
  const data = {
    addressUid,
    dataStatus
  }
  return request({
    url: '/prod-api/customer/address/updateAddressStatus',
    method: 'put',
    data: data
  })
}


// 查询指定客户收货地址列表
export function getByIdAddress(customerUid) {
  return request({
    url: '/prod-api/customer/address/getByIdAddress/'+ customerUid,
    method: 'get'
  })
}
